/*
 * @Author: WangLi
 * @Date: 2024-03-11 22:14:38
 * @LastEditors: WangLi
 * @LastEditTime: 2024-03-19 11:38:50
 */
Component({
  externalClasses: ["custom-class"],
  options: {
    multipleSlots: true,
    addGlobalClass: true,
  },
  properties: {
    placeholder: String,
    value: String,
    type: {
      type: String,
      value: "text",
    },
  },
  methods: {
    onInput(e) {
      let inputValue = "";
      if (e.detail.value.startsWith("0")) {
        inputValue = e.detail.value.substr(1);
      } else {
        inputValue = e.detail.value;
      }
      // 更新 myValue
      this.setData({
        value: inputValue,
      });
    },
  },
});
